|
|
|
|
|
|
|
Public Property Let DBName(ByVal vNewValue As Variant)
strDBName = vNewValue
End Property |
|
|
|
|
|
|
|
|
Adding Methods to the Object Model |
|
|
|
|
|
|
|
|
Now that you have some properties built, you're ready to add some methods to the model. You can execute these methods from within other Visual Basic-compliant applications. |
|
|
|
|
|
|
|
|
First add the Start and CloseApp methods. You can use these to start an instance of SQL-VB5 and close it when you're done (see Listing A.41). |
|
|
|
|
|
|
|
|
Listing A.41. Coding the Start and CloseApp subroutines. |
|
|
|
|
|
|
|
|
Public Sub Start()
'
' starts interactive mode
'
SQLVBMain.Show
'
End Sub |
|
|
|
|
|
|
|
|
Public Sub CloseApp()
'
' end instance of application
'
Dim frmTemp As Form
'
For Each frmTemp In Forms
Unload frmTemp
Next
End
'
End Sub |
|
|
|
|
|
|
|
|
The Run method can be used to run SQL-VB5 against the name in the Script property. |
|
|
|
|
|
|
|
|
Public Sub Run()
'
' calls Run routine
'
If Trim(strScript) <> "" Then
SQLMain strScript
Else
SQLMain
End If
'
End Sub |
|
|
|
|
|